﻿@{
    Layout = null;
}
@using DotNet.Service
@model DotNet.Model.MyEntity.Base_User
<script src="@Url.Content("/Scripts/jQuery/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("/Scripts/jQuery/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $("#Permission_User_ChangePwd").submit(function () {
            return false;
        });
    });

    //回调函数
    function Permission_User_ChangePwd_CallBack(json) {
        if (json.statusCode == DWZ.statusCode.ok) {
            var oahref = $("#kingroad_EPM_OA").attr("href");
            var pwd = oahref.split("=");
            $("#kingroad_EPM_OA").attr("href", pwd[0] + "=" + pwd[1] + "="+ json.data.UserPassword);
            //更新成功
            alertMsg.correct(json.message);
            $.pdialog.closeCurrent();
            $("#background,#progressBar").hide();
        }
        else {
            alertMsg.error(json.message);
        }
    }
   
</script>
<style>
    .form-horizontal .control-label
    {
        line-height: normal;
        padding-top: 3px;
    }
</style>
@using (Html.BeginForm("ChangePwding", "User", null, FormMethod.Post, new { onsubmit = "return validateCallback(this,Permission_User_ChangePwd_CallBack);", @id = "Permission_User_ChangePwd", @class = "pageForm" }))
{ 
    <div class="pageFormContent btnone" layouth="60">
        <div class="form-horizontal forms">
            <div class="form-group">
                <label for="input01" class="col-sm-2 control-label">
                    原密码：</label>
                <div class="col-sm-7">
                    @Html.PasswordFor(m => m.UserOldPassword)
                    @Html.ValidationMessageFor(m => m.UserOldPassword)
                    @Html.HiddenFor(m => m.Id)
                </div>
            </div>
            <div class="form-group">
                <label for="input01" class="col-sm-2 control-label">
                    新密码：</label>
                <div class="col-sm-7">
                    @Html.PasswordFor(m => m.UserPassword)
                    @Html.ValidationMessageFor(m => m.UserPassword)
                </div>
            </div>
            <div class="form-group">
                <label for="input01" class="col-sm-2 control-label">
                    确认密码：</label>
                <div class="col-sm-7">
                    @Html.PasswordFor(m => m.tUserPassword)
                    @Html.ValidationMessageFor(m => m.tUserPassword)
                </div>
            </div>
        </div>
    </div>
    <div class="formBar dialog_bar">
        <ul>
            <li>
                <button type="submit" class="btn btn-success btn-sm">
                    保存</button></li>
            <li>
                <button type="button" class="close btn btn-default btn-sm">
                    取消</button></li>
        </ul>
    </div>
}
